From 4900aad2deab7398e69b1a57a38285fa73974c0f Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Sat, 25 Oct 2025 13:03:55 +0200 Subject: [PATCH] keyboard: Don't move window when it got unmanaged during shift animation When a window with a text-entry at the bottom that had triggered the OSK and was shifted up to avoid overlapping the OSK is closed right after losing keyboard focus, this results in a crash. The focus loss triggers the animation to move the window actor back into its original position, which moves the underlying window when finished. That however will fail when the window has been unmanaged and some of the underlying resources have already been destroyed while the animation was playing. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8752 Part-of: --- js/ui/keyboard.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index e4efb18e0..06f925133 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1920,11 +1920,21 @@ export const Keyboard = GObject.registerClass({ ? this._focusWindowStartY - Main.layoutManager.keyboardBox.height : this._focusWindowStartY; + let unmanaged = false; + const winUnmanagedId = window.connect('unmanaged', () => { + unmanaged = true; + }); + windowActor.ease({ y: finalY, duration: KEYBOARD_ANIMATION_TIME, mode: Clutter.AnimationMode.EASE_OUT_QUAD, onStopped: () => { + window.disconnect(winUnmanagedId); + + if (unmanaged) + return; + windowActor.y = finalY; this._windowSlideAnimationComplete(window, finalY); }, -- 2.39.5